<?php 
class ControllerAccountSuccess extends FrontController {  
	public function index() {
    	$this->document->setTitle($this->_['heading_title']);

      	$this->data['breadcrumbs'][] = array(
        	'text'      => $this->_['text_account'],
			'href'      => US('account/account'),
        	'separator' => $this->_['text_separator']
      	);

      	$this->data['breadcrumbs'][] = array(
        	'text'      => $this->_['text_success'],
			'href'      => U('account/success'),
        	'separator' => $this->_['text_separator']
      	);

    	$this->data['heading_title'] = $this->_['heading_title'];

		M('account/customer_group');
		
		$customer_group = $this->model_account_customer_group->getCustomerGroup($this->customer->getCustomerGroupId());

		if ($customer_group && !$customer_group['approval']) {
    		$this->data['text_message'] = sprintf($this->_['text_message'], U('page/contact'));
		} else {
			$this->data['text_message'] = sprintf($this->_['text_approval'], C('config_name'), U('page/contact'));
		}
		
		if ($this->cart->hasProducts()) {
			$this->data['continue'] = US('checkout/cart');
		} else {
			$this->data['continue'] = US('account/account');
		}
		
		$this->display('common/success.tpl');
  	}
}
?>